package com.zc.domain.single;

import com.zc.domain.BasePo;
import com.zc.model.dao.DaoUtil;
<#if isHasDate!false>
import java.util.Date;
</#if>
/**
 * ${comments!}
 *
 * @since ${lastDdlTime}
 */
public class ${tableName} implements BasePo {

    public String[] getKeyField() {
        return new String[]{${pkName?lower_case!}};
    }

    public String getTableName() {
        return "${tableName?lower_case}";
    }

    <#list oracleColumns as col>
    /**
     *<#if col.comments??> ${col.comments}</#if>
     */
    private <#if (col.dataType=='NUMBER' && col.dataScale gt 0) >double<#elseif (col.dataType=='NUMBER')>long<#elseif (col.dataType=='DATE')>Date<#else>String</#if> ${cus(col.columnName?lower_case)} = <#if (col.dataType=='NUMBER' && col.dataScale gt 0) >DaoUtil.doubleEmpty<#elseif (col.dataType=='NUMBER')>DaoUtil.longEmpty<#else >null</#if>;
    </#list>
<#list oracleColumns as col>
    <#assign cloLower=cus(col.columnName?lower_case)>
    <#assign filedType='String'>
    <#if (col.dataType=='NUMBER' && col.dataScale gt 0) >
        <#assign filedType='double'>
    <#elseif (col.dataType=='NUMBER')>
        <#assign filedType='long'>
    <#elseif (col.dataType=='DATE')>
        <#assign filedType='Date'>
    </#if>

    /**
     *<#if col.comments??> ${col.comments}</#if>
     */
    public ${filedType} get${cloLower?cap_first}() {
        return this.${cloLower};
    }

    /**
     *<#if col.comments??> ${col.comments}</#if>
     */
    public void set${cloLower?cap_first}(${filedType} ${cloLower}) {
        this.${cloLower} = ${cloLower};
    }

    public boolean isEmpty${cloLower?cap_first}() {
    <#if (col.dataType=='NUMBER' && col.dataScale gt 0)>
        return this.${cloLower} == DaoUtil.doubleEmpty;
    <#elseif (col.dataType=='NUMBER')>
        return this.${cloLower} == DaoUtil.longEmpty;
    <#else>
        return this.${cloLower} == null || this.${cloLower}.equals("");
    </#if>
    }

    public boolean isNull${cloLower?cap_first}() {
    <#if (col.dataType=='NUMBER' && col.dataScale gt 0)>
        return this.${cloLower} == DaoUtil.doubleEmpty;
    <#elseif (col.dataType=='NUMBER')>
        return this.${cloLower} == DaoUtil.longEmpty;
    <#else>
        return this.${cloLower} == null;
    </#if>
    }
</#list>
}
